package com.yuyue.dronesystem.beans;

import java.util.Objects;

import com.yuyue.dronesystem.enums.UserAuthority;

/**
 * User
 */
public class User {

    // 用户名
    private String username;
    // 密码
    private String password;
    // 邮箱
    private String email;
    // 手机号
    private String phoneNumber;
    // 用户权限
    private UserAuthority authority;
    // 创建时间
    private Long createTime;
    // 登录时间
    private Long loginTime;
    // 注销时间
    private Long logoutTime;
    // 状态
    private Boolean status;
    // 备注
    private String remark;

    public User() {
    }

    public User(String username, String password, String email, String phoneNumber, UserAuthority authority, Long createTime, Long loginTime, Long logoutTime, Boolean status, String remark) {
        this.username = username;
        this.password = password;
        this.email = email;
        this.phoneNumber = phoneNumber;
        this.authority = authority;
        this.createTime = createTime;
        this.loginTime = loginTime;
        this.logoutTime = logoutTime;
        this.status = status;
        this.remark = remark;
    }

    public String getUsername() {
        return this.username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return this.password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return this.email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhoneNumber() {
        return this.phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public UserAuthority getAuthority() {
        return this.authority;
    }

    public void setAuthority(UserAuthority authority) {
        this.authority = authority;
    }

    public Long getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public Long getLoginTime() {
        return this.loginTime;
    }

    public void setLoginTime(Long loginTime) {
        this.loginTime = loginTime;
    }

    public Long getLogoutTime() {
        return this.logoutTime;
    }

    public void setLogoutTime(Long logoutTime) {
        this.logoutTime = logoutTime;
    }

    public Boolean isStatus() {
        return this.status;
    }

    public Boolean getStatus() {
        return this.status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    public String getRemark() {
        return this.remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public User username(String username) {
        this.username = username;
        return this;
    }

    public User password(String password) {
        this.password = password;
        return this;
    }

    public User email(String email) {
        this.email = email;
        return this;
    }

    public User phoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
        return this;
    }

    public User authority(UserAuthority authority) {
        this.authority = authority;
        return this;
    }

    public User createTime(Long createTime) {
        this.createTime = createTime;
        return this;
    }

    public User loginTime(Long loginTime) {
        this.loginTime = loginTime;
        return this;
    }

    public User logoutTime(Long logoutTime) {
        this.logoutTime = logoutTime;
        return this;
    }

    public User status(Boolean status) {
        this.status = status;
        return this;
    }

    public User remark(String remark) {
        this.remark = remark;
        return this;
    }

    @Override
    public boolean equals(Object o) {
        if (o == this)
            return true;
        if (!(o instanceof User)) {
            return false;
        }
        User user = (User) o;
        return Objects.equals(username, user.username) && Objects.equals(password, user.password) && Objects.equals(email, user.email) && Objects.equals(phoneNumber, user.phoneNumber) && Objects.equals(authority, user.authority) && Objects.equals(createTime, user.createTime) && Objects.equals(loginTime, user.loginTime) && Objects.equals(logoutTime, user.logoutTime) && Objects.equals(status, user.status) && Objects.equals(remark, user.remark);
    }

    @Override
    public int hashCode() {
        return Objects.hash(username, password, email, phoneNumber, authority, createTime, loginTime, logoutTime, status, remark);
    }

    @Override
    public String toString() {
        return "{" +
            " username='" + getUsername() + "'" +
            ", password='" + getPassword() + "'" +
            ", email='" + getEmail() + "'" +
            ", phoneNumber='" + getPhoneNumber() + "'" +
            ", authority='" + getAuthority() + "'" +
            ", createTime='" + getCreateTime() + "'" +
            ", loginTime='" + getLoginTime() + "'" +
            ", logoutTime='" + getLogoutTime() + "'" +
            ", status='" + isStatus() + "'" +
            ", remark='" + getRemark() + "'" +
            "}";
    }
}